<style>
.diy-list{}
.diy-list li{padding:10px;}
.diy-list li h3{line-height:30px;font-weight: 400;}
.diy-list li img{display:inline-block;margin-right:10px;border:1px solid #999;padding:1px;}

</style>

<div>
	<div style="float:left;width:200px;">
		<?php n_mod('user')->sidebar();?>
	</div>
	<div class="main-border">
		<dl class="n-box">
			<dt class="n-box-head">
				<div class="n-right">
					<?=n_ui(n_url('mprank', 'diyAdd'),"新榜单")?>
				</div>
				<b>添加新榜单</b>
				</dt>
			<dd class="n-box-body">
				<?php
				if(!empty($data)){
				?>
				<ul class="diy-list">
					<?php foreach($data as $diy):?>
					<li class="a-bottom-line">
						<div class="n-right" style="line-height:30px;">
							<a href="<?=n_url('mprank', 'show', ['diyId' => $diy['id']])?>" target="_blank">查看</a>
							<a href="<?=n_url('mprank', 'diyedit',['diyId'=>$diy['id']])?>">编辑</a>
							<a href="<?=n_url('mprank','diydel',['diyId'=>$diy['id']])?>">删除</a>
							
						</div>
						<h3><?=$diy['diyname']?></h3>
						<div>
							<?php
							$imgs = json_decode($diy['wxid_set']);
							if(!empty($imgs)){
								$i = 0;
							foreach($imgs as $key=>$val){
								if($i++>5)break;
								?>
								<a href="/weixin/detail.html?wxid=<?=$val?>" target="_blank">
									<img src="/static/weixin_face/<?=$val?>.jpg" title="<?=$val?>" />
								</a>
								<?php
							}
							}else{
								?>
								<div style="color:#999;">暂无公共号，点击<a href="<?=n_url('mprank', 'diyedit',['diyId'=>$diy['id']])?>">[编辑]</a>生成自己的榜单</div>
								<?php
							}
							?>

						</div>
						<!--div>
							榜单中公共号<b>[<?=count($imgs)?>]</b>个
						</div-->
						
					</li>
					<?php endforeach;?>
				</ul>
				<?php
				}else{
				?>
				<div class="n-notice n-sep-top">暂无自定义榜单</div>
				<?php
				}
				?>


			</dd>
		</dl>
	</div>
</div>


